home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Assert messages
- Sent: 7/3/96 3:37 PM
- Received: 7/3/96 2:51 PM
- From: Greg Friedman, friedman@cognosis.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Karl Jepsen wrote:
- > More on the assert messages "Why is an autodestruct object of class
- > TryBlockContext being constructed in a bad context? See FWExcImp.cpp for
- > possible causes. " when gif or JPEG graphic files are embedded into
- > ODFDraw, ODFContainer, or our part where CyperDog is the viewer:
- >
- > CyberDog issues an RequestFrameShape call twice. It is on the 2nd call
- > that the assert messages are output. (why the asserts are generated I do
- > not know). Anyway the calling chain for both of these calls are as
- > follows:
- >
- > cyberdog
- > ODFrame::RequestFrameShape
- > ODPartWrapperRequestFrameShape
- > FW_CODPart::RequestFrameShape <--- this routine causes the asserts
- >
- > Is this a problem with CyberDog & ODF 1? What do we need to do to ODFDraw,
- > ODFContainer, and our part?
-
- I debugged this interaction last night. I didn't want to post a response
- until I had a clear idea of what is happening.
-
- The CyberDog JPEG part is threaded. At the time of the call to
- RequestFrameShape, the JPEG part is executing within a thread. When an ODF
- autodestruct object is created, our emulated exception library tries to
- determine whether the object being created on the stack, in the heap, or
- during static initialization. If the object is on the stack, our exception
- subsystem tracks the object so that it can be correctly destructed when an
- exception is thrown over its stack frame.
-
- The fact that CyberDog is calling us from within an execution thread other
- than the process' primary thread is confusing our exception subsystem. We
- can tell that our autodestruct objects are not being created at static init
- time, and that they aren't in the heap. The problem is that since we are an
- alien execution thread, the stack has been swapped out, and are stack-based
- object logic isn't working.
-
- I consider this an important issue. We will fix it in the next release of ODF.
-
- For now, you have two options:
-
- 1. Ignore the asserts. I realize this is annoying, but there isn't anything
- I can recommend right away.
-
- 2. If you are using a compiler that supports native exceptions (e.g.,
- CodeWarrior 8 or 9), enable native exceptions. You can use the ODFBuilder
- application to do this for the ODF projects. You'll have to do it yourself
- for your own project. The problem will not manifest when native exceptions
- are used.
-
- At some point in the future, The ODF Exception subsystem will go away. Our
- emulated exceptions were put in place long before the popular compilers on
- the Mac had builtin support for exceptions. The goal was to emulate
- exceptions until such time as the compilers we build with implemented real
- exception support.
-
- Greg Friedman.
-
-
- ___________________________________________________________
- Greg Friedman ODF Engineering Apple Computer
-
-
-